/***************************************************************************
 *   Copyright (C) 2007 by Alexandre Masselot,,,   *
 *   alex@alex-laptop   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this program; if not, write to the                 *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef BOLSPECTRAALIGNMENTSCORINGMODEL_H
#define BOLSPECTRAALIGNMENTSCORINGMODEL_H

#include <string>

#include "spectraalignment.h"

namespace bol {

/**
 * Virtual class for the definition of a scoring model. Template class are typically <PeakTheoMsms, PeakIntensity> or <PeakIntensity, PeakIntensity>
 *
 * Such a strucutre contains one scoremodel with parameters, the process for learning etc.
 *
 * It is not the role to the model to manage precursor charges or whatever
 * 
  @author Alexandre Masselot,GeneBio,http://www.genebio.com, <alexandre.masselot@gmail.com>
 */
  template<class A, class B> class SpectraAlignmentScoringModel{
    private:
      string m_description;
    public:
      SpectraAlignmentScoringModel<A,B>(){}

      ~SpectraAlignmentScoringModel(){}

      /**
       * take two aligned spectra and compute a score
       * @param spalign 
       * @return 
       */
      virtual double score(const SpectraAlignment<A,B>& spalign)=0;

      /**
       * setup parameter for the learning phase
       */
      virtual void learn_init()=0;

      /**
       * push a true observation to the learning process
       * @param spalign 
       */
      virtual void learn_pushAlternate(const SpectraAlignment<A,B>& spalign)=0;
      /**
       * add a null observation to the learning process
       * @param spalign 
       */
      virtual void learn_pushNull(const SpectraAlignment<A,B>& spalign)=0;

      /**
       * finalize the learning process and store the data ready to compute scores
       */
      virtual void learn_finalize()=0;
      
      void setDescription(const string& theValue) {
        m_description = theValue;
      }

      string description() const {
        return m_description;
      }

  };

}

#endif
